package cn.com.zhbs.account.util;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @program: vr_manage
 * @description: 权限框架工具类
 * @author: 陈治杰
 * @create: 2021-08-07 15:12
 **/
public class Util {

    public static List<Map<String,Object>> sparatePage(List<Map<String,Object>> list, int start, int pageSize){
        List<Map<String,Object>> resultList=new ArrayList<>();
        if(pageSize==-1){
            resultList=list;
        }else{
            if(list.size()<pageSize){
                pageSize=list.size();
            }
            for(int i=start;i<pageSize+start;i++){
                if(i<list.size()){
                    resultList.add(list.get(i));
                }
            }
        }
        return resultList;
    }
}
